package com.itheima.controller;

import com.itheima.config.SpringConfig;
import com.itheima.pojo.UserInfo;
import com.itheima.service.UserInfoService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/*
* 模拟表现层*/
//1.更改程序运行入口，springjunit
@RunWith(SpringJUnit4ClassRunner.class)
//2.加载核心配置类或者核心配置文件
@ContextConfiguration(classes = {SpringConfig.class})
public class UserController {
    @Autowired
    private UserInfoService userInfoService;
    @Test
    public void findOne(){
        UserInfo userInfo = userInfoService.findOne(2);
        System.out.println(userInfo);
    }
}
